import QtQuick 2.6
import QtQuick.Layouts 1.1
import Qt.labs.settings 1.0
import Qt.labs.controls 1.0
import QtQuick.XmlListModel 2.0

import "../../template" as Template
import "../../js/s/ManagementNavigator.qml.js" as Ln

Template.Navigator {
    id: nav
    title: "设置"

    header:  ToolBar {
        RowLayout {
            anchors.fill: parent
            ToolButton {
                text: "添加"
                onClicked: Ln.post()
            }
            ToolButton {
                text: "修改"
            }
            ToolButton {
            text: "删除"
            }
        }
    }

    ListView {
        anchors.fill: parent
        delegate: ItemDelegate {
            Text { text: title + ": " + pubDate }
        }
        model: XmlListModel {
            id: xmlModel
            source: "http://127.0.0.1/data/xml/feed.xml"
            query: "/rss/channel/item"

            XmlRole { name: "title"; query: "title/string()" }
            XmlRole { name: "pubDate"; query: "pubDate/string()" }
        }
    }
}
